In a computing environment, virtual memory is a technique that can give a computer application an impression that it is utilizing contiguous physical memory from the computer system, while its memory location may actually be fragmented, or even operated partially from disk storage. A computer system's memory may be allocated among kernel space and user space, for example, as virtual memory by the computer's operating system. The kernel space memory is typically reserved for running the kernel, its extensions, and kernel modules. The user space memory is typically used for running user mode applications. User space operations cannot typically access kernel space memory, while kernel space operations can map parts of user space memory to its own memory. That is, kernel operations can bleed over into user space, but user operations are typically not allowed to bleed over into kernel space.
A kernel is a basic component of an operating system on a computer system that can provide an abstraction layer for computer system resources, such as memory, processors, and input/output (I/O) devices. The kernel, for example, allows system resources to interact with application software running in user space that is often used to control these system resources.
A computer system typically allocates a portion of its main volatile memory (RAM) to the kernel and another portion of the RAM to the user space, creating a segregated virtual memory. In some systems, a portion of the user space memory may “spill over” to hard disk storage where, for example, RAM is limited. In this manner, some user applications can be swapped out to disk as needed. Kernel memory, on the other hand, is typically not swapped out to disk, but is instead maintained in RAM.
Normally, user space processes run in their own portion of the virtual memory and typically cannot access memory of another process. However, sometimes a process in user space may request the kernel to map a portion of another process's memory to its own, or may request shared memory regions with another process. Further, the kernel may need to access data in user space memory, such as persistently stored user space data, when a new kernel module comes online. For example, the kernel may need to access data regarding an operating system configuration, local settings, application settings, etc. that is stored in user space memory.
At startup, a certain number of kernel modules are loaded that correspond to expected system resources. However, not all possible kernel modules may be loaded because some potential resources may not be expected to be used, and/or are unknown. As such, for example, if a new resource becomes available to the system, a kernel module associated with the resource may then be loaded and request the user space memory to associate the new resource. In this example, the kernel may have to access the user space persistently stored data (e.g., configuration data) in order to associate the resource with a user space application process. Because the user space persistently stored data may be located on disk storage (e.g., have “spilled over” to hard disk storage), retrieval of the data can take a long time. Even if the data is not stored on disk, the kernel's attempt to retrieve data from the user space memory can slow down a computer system, for example, that may need fast loading kernel modules.
Therefore, some systems may cache (e.g., store, maintain) some user space persistently stored data to kernel space memory (this is generally referred to as kernel in-memory data cache), for example, at system boot. In this way, user space data needed for a kernel I/O module may be loaded more quickly. However, replicating data from user space to kernel space can be slow, and may impact boot time of a system, which can further exacerbate down time of a system if the system is rebooting after it goes down. Further, the data cache of user space persistently stored data is lost from volatile memory (e.g., RAM) during a system reboot (e.g., after a power loss), and will have to be re-replicated to the kernel space memory at a subsequent boot time, for example.